<%--
  @desc: 栏目新增
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    .pageFormContent .textInput {
        width: 220px;
    }

    .pageFormContent .fix_p {
        width: 310px;
    }

    .gray {
        color: gray;
    }
</style>
<div class="pageContent">
    <div class="pageFormContent" style="height: 230px;">
        <p>
            <label for="txt_content_type" class="required">类型</label>
            <input id="txt_content_type" readonly type="text" name="txt_content_type" maxlength="50"  value=""/>
        </p>

        <p>
            <label for="txt_title">标题</label>
            <input id="txt_title" readonly type="text" name="txt_title" maxlength="300" value=""/>
        </p>
		
		<p>
            <label for="txt_obj">推送对象</label>
            <input id="txt_obj" readonly type="text" name="txt_obj" maxlength="300" value=""/>
        </p>
        
        <p style="height: 70px;">
            <label for="txt_message">内容</label>
            <textarea id="txt_message" readonly name="txt_message" rows="10" style="resize:none" maxlength="100"></textarea>
        </p>
        <!--
        <p>
            <label for="txt_extras">扩展内容</label>
            <textarea id="txt_extras" readonly name="txt_extras" rows="3"  maxlength="100"></textarea>
        </p>
        -->
    </div>
</div>
<script type="text/javascript">
    $(function () {
        if ('' != '${msg.msg_content}') {
            var dataObj = ${msg.msg_content};
            $("#txt_content_type").val(getTypeStr(dataObj.content_type));
            $("#txt_title").val(dataObj.title);
            $("#txt_message").val(dataObj.message);
            //$("#txt_extras").val(eval(dataObj.extras));
        }
        var pushObj = '${msg.receiver_value}';
        if(pushObj==''){//推送对象为空设为广播
        	$("#txt_obj").val('广播');
        }
        if(pushObj=='reg'){//注册用户
        	$("#txt_obj").val('注册用户');
        }
        if(pushObj=='unreg'){//未注册用户
        	$("#txt_obj").val('未注册用户');
        }
        var start = pushObj.indexOf("pap_");
        if(start==0){//以pap_开头，指定用户手机
        	$("#txt_obj").val(pushObj.substring(4));
        }
    });

    function getTypeStr(type) {
        switch (type) {
            case 1:
                return "办件过程";
            case 2:
                return "公示公告";
            case -1:
                return "系统通知";
            case -2:
                return "升级信息";
            case -3:
                return "新闻通知";
            default :
                return "未知类型：" + type;
        }
    }
</script>